package com.hongkuncheng.cms.controller.index;

import java.util.Date;

import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Controller;
import com.hongkuncheng.cms.controller.BaseController;
import com.hongkuncheng.cms.helper.CookieHelper;
import com.hongkuncheng.cms.model.Visitpv;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@Transactional
@RequestMapping("visitpv")
@ResponseBody
public class IvisitpvController extends BaseController {

    @RequestMapping("increase")
    public void increase() {
        if (CookieHelper.GetCookie(request, "visitpvnum", false) == null) {
            Visitpv visitpv = new Visitpv();
            visitpv.setVisittime(new Date());
            factorySession.save(visitpv);
            CookieHelper.SetCookie(response, "visitpvnum", "", 3600, false);
        }
    }

}
